package com.tang.excel.oci.mapper;

import com.tang.excel.oci.domain.GullyWarmWater;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Tang
 * @classname GullyWarmWaterMapper
 * @description [  ]
 * @date 2021/6/3 11:29
 */
public interface GullyWarmWaterMapper {

    @Insert(value = {
            "<script>",
            "insert into gully_warm_water (id,save_date,warm_cod, gully_wastewater_flow, gully_ph, \n" +
                    "      gully_cod, gully_emissions, \n" +
                    "      update_time, operator_user) values \n" +
            "<foreach item = 'item' collection = 'gullyWarmWaters' separator = ','>",
            "(null ,#{item.saveDate},#{item.warmCodeValue,jdbcType=DOUBLE}, #{item.wastewaterFlowValue,jdbcType=DOUBLE}, #{item.gullyPh,jdbcType=DOUBLE}, \n" +
                    "#{item.codValue,jdbcType=DOUBLE}, #{item.emissionsValue,jdbcType=DOUBLE}, \n" +
                    "#{item.updateTime,jdbcType=TIMESTAMP}, #{item.operatorUser,jdbcType=VARCHAR} )",
            "</foreach>",
            "</script>"
    })
    void batchInsert(@Param("gullyWarmWaters") List<GullyWarmWater> gullyWarmWaters);

}